<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        ul{
            height: 500px;
            background-color: #0a6999;
        }
        li{
            float: left;
            margin-left: 20px;
            list-style: none;
            width: 100px;
            height: 50px;
            line-height: 50px;
            background-color: #333333;
            color:#fff;
            text-align: center;
            font-size: 16px;
        }
    </style>
</head>
<body>
   <ul class="container">
       <li id="list">1</li>
   </ul>
</body>
<script>
//    var list=document.getElementsByClassName("list cc");
    var xx=document.getElementsByClassName("container")[0];
    xx.onclick=function(e){
//        console.log(e);
        if(e.target.id=="list"){
            console.log(1);
            var list=document.getElementById("list");
            list.onclick=function(){
                alert(11);
            }
        }
    }
</script>
</html>